<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/context/mytags.jsp"%>
<div class="easyui-layout" fit="true">
  <div region="center" style="padding:1px;">
  <t:datagrid name="purchaseSheetList" title="采购申请单" actionUrl="purchaseSheetController.do?datagrid" idField="id" fit="true" checkbox="true">
   <t:dgCol title="编号" field="id" hidden="false"></t:dgCol>
   <t:dgCol title="申请单号" field="applyNumber" ></t:dgCol>
   <t:dgCol title="申请人" field="applicant" ></t:dgCol>
   <t:dgCol title="申请时间" field="applyDate" formatter="yyyy-MM-dd"></t:dgCol>
   <t:dgCol title="物料名称" field="materialName" ></t:dgCol>
   <t:dgCol title="规格型号" field="size" ></t:dgCol>
   <t:dgCol title="物料单位" field="materialUnit" ></t:dgCol>
   <t:dgCol title="申请数量" field="quantity" ></t:dgCol>
   <t:dgCol title="物料单价" field="unitPrice" ></t:dgCol>
   <t:dgCol title="申请总金额" field="totalMoney" ></t:dgCol>
   <t:dgCol title="供应商" field="suppliers" ></t:dgCol>
   <t:dgCol title="说明" field="note" ></t:dgCol>
   <t:dgCol title="申请部门" field="deptid" ></t:dgCol>
   <t:dgCol title="当前状态" field="fstate" dictionary="auditState"  style="setColor()"></t:dgCol>
   <t:dgCol title="操作" field="opt" width="100" hidden="false"></t:dgCol>
   <t:dgDelOpt title="删除" url="purchaseSheetController.do?del&id={id}" />
   <t:dgToolBar title="录入" icon="icon-add" url="purchaseSheetController.do?addorupdate" funname="add"></t:dgToolBar>
   <t:dgToolBar title="编辑" icon="icon-edit" url="purchaseSheetController.do?addorupdate" funname="update"></t:dgToolBar>
   <t:dgToolBar title="查看" icon="icon-search" url="purchaseSheetController.do?addorupdate" funname="detail"></t:dgToolBar>
   <t:dgToolBar title="通过" icon="icon-edit" url="purchaseSheetController.do?checkSelect" funname="checkSelect"></t:dgToolBar>
   <t:dgToolBar title="不通过" icon="icon-edit" url="purchaseSheetController.do?unCheckSelect" funname="unCheckSelect"></t:dgToolBar>
  </t:datagrid>
  </div>
 </div>
  <script>
 	function setColor(value,rec,index){
 		
 		if(value==2){
 			return "color:red;";
 		}
 		if(value==1){
 			return "color:green;";
 		}
 		return "";
 	}
 </script>
